A. Technical Field of the Invention
The present invention relates to a driving method of speaker, and in particular, to a driving method and a driving circuit of speaker by the application of both pulse width modulation (PWM) and digital to analog converter (DAC) technique.
B. Description of the Prior Art
Digital sound playing is an important function of consumer electronic products. Generally, there are two basic types of driving method of outputting digital sound via speaker, i.e., digital to analog converter driving method and pulse width modulation driving method.
FIG. 1 illustrates a circuit diagram of traditional DAC. In this driving method, digital sound data are converted into analog signals with responding current value, and then these analog signals are directly drive the speaker. As shown in FIG. 1, each bit of digital sound data, Bit 0˜Bit 7, is used to control a corresponding current amplifier with different current ratio, and the output of each current amplifier are commonly connected to the speaker. During playing, digital sound data are sequentially input to the DAC with the speed of sampling rate. In integrated circuit design, each current amplifier and control switch can be implemented by MOS elements with different area.
FIGS. 2 and 3 illustrate the waveform modulated by PWM and its implementation structure. The action principle of PWM is to modulate sound amplitude onto pulse width, not onto pulse height. When the modulation pulse frequency is far higher than the sound frequency, the sound amplitude can be represented by pulse width and drive a speaker. Assume the PWM is implemented digitally and the amplitude, pulse width are equally divided into 255 parts, i.e. represented as 28, then the sound amplitude is 255 level, and pulse width is also represented by 255 level in the PWM. The waveform modulated by PWM is shown in FIG. 2 and its block diagrams are shown in FIG. 3. The action principle is that digital sound data Wd and the output of a counter are input to a comparator at the same time. At the beginning of every sampling pulse, digital sound data Wd is input to the comparator and the counter starts to count. At this instance, the output of the comparator is HI. When the count value reaches the value of Wd, the output of the comparator is become LOW. Thus, the waveform of FIG. 2 is obtained.
Under this principle of PWM, the sound amplitude is represented by pulse width, and the pulse width is determined by the counting of a counter. Thus, the linearity of the sound driving signals are determined by the counter, and the clock pulse of the counter is provided by the quartz oscillator. Because the accuracy of quartz oscillator is high, thus, the advantage of PWM is that the linearity of the sound driving signals is good and the quality of sound can be easily controlled. In addition, the factors determining the sound quality for this sound driving method are as follows.
1) Modulation frequency; and
2) Sound resolution.
If the modulation frequency is too low, aliasing phenomenon will affect the sound quality. Thus, in the application of PWM, the modulation frequency has to be fixed. If the reference clock pulse in PWM is 4 MHz, the acceptable lowest modulation frequency is assumed to be F Hz, then the sound level is 4M/F (integer). If the reference clock pulse in PWM becomes to 2 MHz, then the sound level is lowered to 2M/F, which lowers the sound resolution, and the sound quality becomes poor. Thus, in the application of PWM, in order to achieve a specific sound quality, one basic requirement is the higher speed clock pulse.
However, the advantage of the DAC driving method is that the required clock pulse is equal to the sampling rate of sound signals, thus, the requirement of clock pulse is low. But the drawback is that the linearity of the amplifier is lowered while the required playing sound is large and the output current of each current amplifier is large. Thus, loss of fidelity of sound is occurred. In the PWM driving method, because sound amplitude is represented by pulse width and the pulse width is determined by the counting of the counter, the linearity of sound is determined by the counter. As the linearity of the sound is determined by the counter, and the clock pulse of the counter is provided by the quartz oscillator with great accuracy, the linearity of the sound driving signals are good and the quality of sound can be easily controlled. The only drawback is that a higher speed clock pulse is required.